﻿@{
    ViewBag.Title = "模具档案用户单位管理";
    Layout = "~/Views/Shared/_ManufactureList.cshtml";
}

<style type="text/css">
    #print {
        display: none;
    }

    .tool_c {
        padding: 10px 0;
    }

    .btn-group {
        padding: 0 10px 0 0;
    }

        .btn-group:last-child a.btn:first-child {
            margin: 0 0.5em 0 0 !important;
        }

    .input_inline input {
        display: inline-block;
        width: 4em;
    }

    .btn-group input {
        height: 2em !important;
    }
</style>
<script>
    $(function () {
        Index.init();
    });

    var Index = {
        dataList: null,
        init: function () {
            with (Index) {
                loadDataList();

                initControl();
            }
        },
        initControl: function () {
            $('select').bindSelect();
            //查询 btn_search1
            $("#btn_search1").on("click", function () {
                var $gridList1 = $("#gridList1");

                var conn1 = {
                    "FProductNO": $("#FProductNOQuery").val()
                };

                $gridList1.jqGrid('setGridParam', {
                    postData: conn1,
                }).trigger('reloadGrid');
            });
        },
        loadDataList: function () {
            var conn1 = {
                "FProductNO": $("#FProductNOQuery").val()
            };
            var $gridList1 = $("#gridList1");
            $gridList1.dataGridForJson({
                url: "/BaseData/MouldArchive/GetMouldArchivieUnits",
                postData: conn1,
                height: $(window).height() - 220,
                colModel: [
                { label: '产品编号', name: 'FProductNO', width: 280, align: 'left', sortable: false },
                { label: '产品名称', name: 'FProductName', width: 280, align: 'left', sortable: false },
                { label: '', name: '', width: $(window).width() - 1020, align: 'left', sortable: false }
                ],
                pager: "#gridPager1",
                sortname: 'FProductionNO asc',
                viewrecords: true,
                rownumWidth: 50,
                onSelectRow: function (rowId) {
                    var cols = "FProductNO".split(",");

                    rowData = $gridList1.jqGrid('getRowData', rowId);

                    cols.forEach(function (item) {
                        $("#{0}".format(item)).val(rowData[item]);
                    });
                },
                loadComplete: function (data) {
                    Index.dataList = data;
                }
            });

            $gridList1.jqGrid('setFrozenColumns');

            $gridList1.jqGrid('setLabel', 0, '序号', 'rowNumberHeaderStyle');
        }
    };



</script>
<div class="layout" id="layout" style="height: 100%; width: 100%;">
    <div class="tool_c">
        <div class="btn-group input-width-185">
            &nbsp;产品车型分布<br />
            <input id="FProductNOQuery" name="" placeholder="" type="text" class="form-control required" />
            <input id="FProductNO" type="hidden"/>
        </div>
        <div class="btn-group">
            <a id="btn_search1" class="btn btn-primary center-block"><span class="glyphicon glyphicon-search"></span>查询</a>
        </div>
    </div>
    <div class="grid_list_1_c" style="margin-top: 5px;">
        <table id="gridList1"></table>
        <div id="gridPager1"></div>
    </div>
</div>
